<?php
$this->breadcrumbs = array(
	'申购单列表' => array(
		'index'
	),
	$model->project->name . ' (' . $model->submitDate . ')',
);

$this->userActions = array(
	array(
		'label' => '申购单列表',
		'url' => array(
			'index'
		),
		'iconClass' => 'icon-basket-add',
	),
	array(
		'label' => '管理申购单',
		'url' => array(
			'admin'
		),
		'iconClass' => 'icon-basket',
		'visible' => Yii::app()->user->checkAccess('materialRequisitionManage'),
	),
	array(
		'label' => '新建申购单',
		'url' => array(
			'create'
		),
		'iconClass' => 'icon-basket-add',
		'visible' => Yii::app()->user->checkAccess('materialRequisitionManage'),
	),
	array(
		'label' => '更新申购单',
		'url' => array(
			'update',
			'id' => $model->id
		),
		'iconClass' => 'icon-basket-edit',
		'visible' => Yii::app()->user->checkAccess('materialRequisitionManage'),
	),
	array(
		'label' => '删除申购单',
		'url' => '#',
		'linkOptions' => array(
			'submit' => array(
				'delete',
				'id' => $model->id
			),
			'confirm' => '确定要删除这个申购单？'
		),
		'iconClass' => 'icon-basket-delete',
		'visible' => Yii::app()->user->checkAccess('materialRequisitionManage'),
	),
	array(
		'label' => '更新申购单内容',
		'url' => array(
			'updateItems',
			'id' => $model->id
		),
		'iconClass' => 'icon-basket',
		'visible' => Yii::app()->user->checkAccess('materialRequisitionManage'),
	),
);
?>

<h1>材料申购单</h1>
<div class="">
<div class="span-2"><?php echo CHtml::encode($model->submitDate);
					?></div>

<div class="span-3"><?php echo CHtml::encode($model->project->name); ?></div>
<div class="span-2">
	<?php echo CHtml::encode($model->getAttributeLabel('approverId')); ?>:
	<?php echo CHtml::encode($model->approver->fullName); ?>
</div>
<div class="span-2">
	<?php echo CHtml::encode($model->getAttributeLabel('warehouseManagerId')); ?>:
	<?php echo CHtml::encode($model->warehouseManager->fullName); ?>
</div>
<div class="span-4">
	<?php echo CHtml::encode($model->getAttributeLabel('token')); ?>:
	<?php echo CHtml::encode($model->token); ?>
</div>
<div class="clear"></div>
<?php if ($model->note) { ?>
<div><?php echo CHtml::encode($model->getAttributeLabel('note')); ?>:
	<?php echo CHtml::encode($model->note); ?></div>
<?php } ?>

</div>
<div class="item-list-grid">
<?php
$this
	->renderPartial('_itemList', array(
		'items' => $model->items,
		'project' => $model->project
	))
?>
</div>
<div>

<div class="span-7 item-meta">
	创建：<?php echo CHtml::encode($model->createUser->employee->fullName); ?>
	(<?php echo CHtml::encode($model->createTime); ?>)
</div>
<?php if ($model->updateUserId) { ?>
<div class="span-7 item-meta">
	最后更新：<?php echo CHtml::encode($model->createUser->employee->fullName); ?>
	(<?php echo CHtml::encode($model->createTime); ?>)
</div>
<?php } ?>
</div>
